﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Developer.Core.FrameWork.Common.Results
{
    /// <summary>
    /// 微服务通用结果
    /// </summary>
    public class MicroCommonResult
    {
        public string Success { get; set; }
        public string ErrorInfo { get; set; }
        public IDictionary<string, object> ResultDic { get; set; } // 单个返回结果
        public IList<IDictionary<string,object>> ResultList { get; set; } // 结果集返回

        public dynamic Result { get; set; } // 动态结果（通用）

        public MicroCommonResult()
        {
            this.ResultDic = new Dictionary<string, object>();
            this.ResultList = new List<IDictionary<string, object>>();
        }

        public MicroCommonResult(string Success,string ErrorInfo)
        {
            this.Success = Success;
            this.ErrorInfo = ErrorInfo;
            this.ResultDic = new Dictionary<string, object>();
            this.ResultList = new List<IDictionary<string, object>>();
        }

        public MicroCommonResult(string Success,string ErrorInfo,IDictionary<string,object> ResultDic,IList<IDictionary<string,object>> ResultList)
            :this(Success,ErrorInfo)
        {
            this.Success = Success;
            this.ErrorInfo = ErrorInfo;
            this.ResultDic = ResultDic;
            this.ResultList = ResultList;
        }
    }
}
